package com.woniuxy.commons.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author rmw
 * @date 2020/12/5 12:09
 * 生成随机数字的工具类
 */
public class NumberUtil {
    /**
     * 司机编号
     * @return
     */
   public static String driverNo(){
       String no = "WN";
       SimpleDateFormat date = new SimpleDateFormat("YYYY-MM-dd");
       no += date.format(new Date());

       String num = "" + new Random().nextInt(1000);

       for (int i = 0;i < 4 - num.length();i++){
           num = "0" + num;
       }
       return no + num;
   }
}
